1. /* scfcsinh.cpp by K.Tsuru */
  2. // function ID = 9110
  3. /*****************************************
  4. SComplex class
  5. It returns sinh(z).
  6. Let z = x+iy,
  7. sinh(z) = sinh(x)*cos(y)+i*cosh(x)*sin(y).
  8. *****************************************/
  9. #ifndef SN_H
  10. #include "sn.h"
  11. #endif
  12. #define UseCSBScsinh 0
  13. SComplex Csinh(const SComplex& z)
  14. {
  15. #if UseCSBScsinh // 16.09 sec
  16. SDouble chx, shx, cy, sy, x(Re(z)), y(Im(z));
  17. Hyperbolic(x, chx, shx); // chx = cosh(x) shx = sinh(x)
  18. CosSinBS(y, cy, sy); // cy = cos(y), sy = sin(y);
  19. return SComplex(shx*cy, chx*sy);
  20. #else // 16.15 sec
  21. SDouble rr, ri, sh, s, c;
  22. sh = Sinh(z.Real());
  23. s = Sin(z.Imag());
  24. if( (s.PreferSpeed() == ON) && (s.NetRdxExp() > -2) ){
  25. c = Sqrt(1.0-s*s); // |s| is O(1.0).
  26. }else c = Cos(z.Imag()); // |s| is very small.
  27. rr = sh*c; // sinh(x)*cos(y)
  28. ri = Sqrt(1.0+sh*sh)*s; // cosh(x)*sin(y)
  29. return SComplex(rr, ri);
  30. #endif
  31. }

scfcsinh.cpp : last modifiled at 2015/08/17 11:34:56(942 bytes)
created at 2017/10/06 15:21:28
The creation time of this html file is 2017/10/06 15:27:09 (Fri Oct 06 15:27:09 2017).